function format(value, maxlen, align) {
	len=length(value);
	lendiff=maxlen-len;
	if (lendiff>0) {
		for (k=0; k<lendiff; k++) {
			if(align=="right") {
				value=value" ";
			} else {
				value=" "value;
			}
		}
	}
	return value;
}
BEGIN {
	rows=0;
	cols=5;
}
{
	if(NF==cols) {
		for(i=1; i<=NF; i++) {
			if (length($i) > lengths[i]) lengths[i]=length($i);
		}
		rows++;
		for(col=1; col<=NF; col++) {
			data[rows, col]=$col;
		}
	}
}
END {
	for(i=1; i<=length(lengths); i++) {
		lengths[i]=lengths[i]+4;
	}
	for(i=1; i<=rows; i++) {
		print format(data[i, 1], lengths[1]), format(data[i, 2], lengths[2], "right"), format(data[i, 3], lengths[3], "right"), format(data[i, 4], lengths[4], "right"), format(data[i, 5], lengths[5])
	}
}
